const express = require('express')
const router = express.Router()

// 1. 导入验证表单数据的中间件
const expressJoi = require('@escook/express-joi')

const greatperson = require('../router_handler/greatperson_handler')
// 导入校验文件
const greatperson_handler = require('../schema/greatperson_scheam')


router.post('/', expressJoi(greatperson_handler.post), greatperson.post )

router.get('/', greatperson.get)
router.put('/', expressJoi(greatperson_handler.put), greatperson.put)
router.delete('/:id', expressJoi(greatperson_handler.delete), greatperson.delete)

// 根据分类查询
router.get('/classify', expressJoi(greatperson_handler.get_by_classify),greatperson.get_by_classify)



module.exports = router
